<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div class='app-container'>
    <el-form ref="form" :model="t_hours" :rules="rules" label-width="100px" id="mvcfm">
      <el-button @click="gotoPage('/psi/supplychainmana/WarehouseUpdate?'+vueparams+'')" type='success' size="mini"><i class='fa fa-edit'></i>修改</el-button>
      <el-button @click="gotoPage('/psi/supplychainmana/WarehouseList2?'+vueparams+'')" type='primary' size="mini"><i class='fa fa-reply'></i>返回</el-button>
      <div class="form-unit">
        <span class="mvc-title-left"> 仓库区域明细 </span>
      </div>
      <div>
        <el-row>
          <el-col :span="24">
            <el-form-item label="仓库区域条形码" prop="hours_barcode">
              {{t_hours.hours_barcode}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="12">
            <el-form-item label="仓库区域编号" prop="hours_num">
              {{t_hours.hours_num}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="仓库名称" prop="hours_type">
              {{t_hours.firm_name}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="区域名称" prop="">
              {{t_hours.name}}
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="24">
            <el-form-item label="备注" prop="remark">
              {{t_hours.remark}}
            </el-form-item>
          </el-col>
        </el-row>
      </div>
      <el-button @click="popWarehouseStaffChoice('')" type='primary' size="mini">添加</el-button>
      <div class="form-unit">
        <span class="mvc-title-left"> 仓库操作人员 </span>
      </div>
      <el-table :data="s_staff">
        <el-table-column label="操作" align="center" width='100' type=''>
          <template slot-scope="scope">
            <el-dropdown trigger="click">
              <span class="el-dropdown-link">操作<i class="el-icon-arrow-down el-icon--right"></i></span>
              <el-dropdown-menu slot="dropdown">
                <el-dropdown-item>
                  <el-link @click="d_staff('&CMIDstaff_id='+scope.row.staff_id+'')">删除</el-link>
                </el-dropdown-item>
              </el-dropdown-menu>
            </el-dropdown>
          </template>
        </el-table-column>
        <el-table-column label="姓名" prop="contact_name">
        </el-table-column>
        <el-table-column label="联系方式" prop="relation_tel">
        </el-table-column>
      </el-table>
    </el-form>
    <el-dialog :visible.sync="WarehouseStaffChoiceVisible" append-to-body>
      <WarehouseStaffChoice v-if="WarehouseStaffChoiceVisible" ref="WarehouseStaffChoice" :popparams="popparams"> </WarehouseStaffChoice>
    </el-dialog>
  </div>
</template>
<script>
  import request from '@/utils/request'
  import WarehouseStaffChoice from "@/views/psi/supplychainmana/WarehouseStaffChoice";
  export default {
    name: 'WarehouseDet',
    components: {
      WarehouseStaffChoice,
    },
    props: ['popparams'],
    data() {
      return {
        WarehouseStaffChoiceVisible: false,
        WarehouseStaffChoiceValue: null,
        WarehouseStaffChoiceDesc: null,
        vueparams: this.getVUEParams(""),
        t_hours: {
          hours_barcode: null,
          hours_num: null,
          firm_name: null,
          name: null,
          remark: null,
        },
        s_staff: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/psi/supplychainmana/WarehouseDet/warehouseDet?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      d_staff(_params) {
        request({
          method: 'post',
          url: '/xcapi/VUEAction/psi/supplychainmana/WarehouseDet/d_staff?' + _params + this.vueparams,
          data: this.postData()
        }).then(data => {
          this.$router.replace("/redirect" + this.$route.fullPath);
          this.msgSuccess(data.msg);
        })
      },
      popWarehouseStaffChoice(params) {
        if (params != "") this.popparams = params + this.vueparams;
        this.WarehouseStaffChoiceVisible = !this.WarehouseStaffChoiceVisible;
      },
    },
  }
</script>
